// bool, Obj This, Obj other

Hero this;
Building bld;
Settlement sett;
str cmmd;

this = This.AsHero();
if(!.IsValid()) return false;
bld = other.AsBuilding();
if(!bld.IsValid()) return false;
if(.IsEnemy(bld)) return false;
if(!.HasArmy()) return false;
if(.InHolder()) return false;
if(!.EnemiesInSight()) return false;
cmmd = .command;
if(cmmd == "retreat_notai") return false;
if(cmmd == "retreat_bld_notai") return false;
if(cmmd == "great_charge") return false;
if(bld.IsHeirOf("BaseRuins")) return false;
if(!bld.IsCentralBuliding()) return false;	
if(bld.IsHeirOf("Catapult")) return false;
if(bld.IsHeirOf("TTent")) return false;
if(bld.IsHeirOf("GreatTavern")) return false;
sett = bld.settlement;
if(!sett.IsValid()) return false;
if(sett.max_units==0) return false;
if(sett.max_units==sett.UnitsCount) return false;
if(!DiplGetShareView(bld.player, .player)) return false;

return true;
